package me.rainsay;

public class PathNode {

    private String name;

    private PathType type;

    private PathNode next;

    public PathNode(String name, PathType type) {
        this.name = name;
        this.type = type;
    }

    public PathNode() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public PathType getType() {
        return type;
    }

    public void setType(PathType type) {
        this.type = type;
    }

    public PathNode getNext() {
        return next;
    }

    public PathNode setNext(PathNode next) {
        this.next = next;
        return this;
    }

    @Override
    public String toString() {
        return "{" +
                "name='" + name + '\'' +
                ", type=" + type +
                '}';
    }

    public String listString() {
        StringBuilder b = new StringBuilder(this.toString());
        PathNode tn = this.next;
        while(tn != null) {
            b.append(tn.toString()).append(",");
            tn = tn.getNext();
        }
        return b.toString();
    }
}
